<?php foreach($products->result() as $p):?>
    <div class="product">
        <div class="product-image">
            <a href="<?php echo base_url(); ?>products/view/<?php echo $p->id; ?>">
                <img class="img-product" src="<?php echo base_url(); ?>photo/products/main/<?php echo $p->main_photo; ?>" alt="<?php echo $p->name; ?>"/>
            </a>
        </div>
        <div class="product-title">
            <h2>
                <a href="<?php echo base_url(); ?>products/view/<?php echo $p->id; ?>"><?php echo $p->name; ?></a>
            </h2>
        </div>
        <div class="product-desc">
            <p><?php echo substr(strip_tags($p->description), 0, 150); ?> <a href="<?php echo base_url(); ?>products/view/<?php echo $p->id; ?>">(...)</a></p>
        </div>
        <div class="product-price">
            <p>- IDR&nbsp;&nbsp;<?php echo number_format($p->price, 0, '', ' '); ?></p>
        </div>
    </div>
<?php endforeach; ?>